fix(container): add git safe.directory to setup.sh#80
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bind-mounted /workspaces may have a different uid than the container user, causing Git to refuse all operations with "dubious ownership" errors (CVE-2022-24765). Runs on every container start before any setup stages.
git config fails with exit code 5 when safe.directory already has multiple values. Using --add prevents this, and the error handler logs a warning consistent with the chown pattern above.
f283d05 to
0fc0fae
Compare
|
Fix applied: Changed
|
Summary
git config --global safe.directorytosetup.sh, running on every container start before setup stages/workspaces${WORKSPACE_ROOT:-/workspaces}for consistency with existingsetup.shpatternsTest plan
git config --global --get-all safe.directory— should output/workspacescdinto any project under/workspacesand rungit status— no "dubious ownership" error